package com.qianfeng.chinamobile.strategy.mq;

import com.qianfeng.chinamobile.strategy.service.DataFilerManger;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;
import com.qianfeng.smsplatform.common.model.Standard_Submit;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class StandMessageListener {

    private DataFilerManger dataFilerManger;
    @Autowired
    public void setDataFilerManger(DataFilerManger dataFilerManger) {
        this.dataFilerManger = dataFilerManger;
    }
    @RabbitListener(queues = RabbitMqConsants.TOPIC_PRE_SEND)
    @Async
    public void onMessage(Standard_Submit standard_submit) {
        System.err.println("受到了接口模块发来的短信消息，用于检查校验");
        System.err.println(standard_submit);
        dataFilerManger.dealSms(standard_submit);//处理短信
    }
}
